<?php
if(isset($include) && $include) {
?>
<?php
require_once('classes/user.class.php');

if(User::isLoggedIn()) {
	echo "<p>Je bent reeds ingelogd met ...</p>";
	echo "<p><a href=\"\">uitloggen</a></p>";
} else {
	echo "<p>Login met je persoonlijke code:</p>";
	$localUserList = User::getLocalUserList(); //setcookie("cookie[username]", "hash/1"); -> 1 of 0 geeft default logged in aan
	/*if (isset($_COOKIE['cookie'])) {
    foreach ($_COOKIE['cookie'] as $name => $value) {
        echo "$name : $value <br />\n";
    }
}*/
	echo "<form method=\"post\" action=\"pay2.php\">";
	echo "selecteer gebruiker:<br />";
	echo "<select name=\"personalcode\">";
	foreach($localUserList as $name => $value)
		echo "<option value=\"".$value."\">".$name."</option>";
	echo "</select><br />";
	echo "of geef je persoonlijke code in (enkel als je op je eigen computer zit!):<br />";
	echo "<textarea name=\"personalcode2\"></textarea><br />";
	echo "<input type=\"submit\" name=\"hash\" value=\"inloggen\">";
	echo "</form>";
	
	echo "<p>Login met je gebruikersnaam en wachtwoord:</p>";
	echo "<form method=\"post\" action=\"pay2.php\">";
	echo "gebruikersnaam: <input type=\"text\" name=\"username\">";
	echo "wachtwoord: <input type=\"password\" name=\"password\">";
	echo "<input type=\"submit\" name=\"login\" value=\"inloggen\">";
	echo "</form>";
}
?>

<?php
}
?>